/*
 * Copyright 2023 NXP
 * SPDX-License-Identifier: MIT
 */

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"

lv_calendar_date_t today;
void setup_scr_screen_2(lv_ui *ui){

	//Write codes screen_2
	ui->screen_2 = lv_obj_create(NULL, NULL);

	//Write style LV_OBJ_PART_MAIN for screen_2
	static lv_style_t style_screen_2_main;
	lv_style_reset(&style_screen_2_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_2_main
	lv_style_set_bg_color(&style_screen_2_main, LV_STATE_DEFAULT, lv_color_make(0xb2, 0xf5, 0xdf));
	lv_style_set_bg_opa(&style_screen_2_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_2, LV_OBJ_PART_MAIN, &style_screen_2_main);

	//Write codes screen_2_img_1
	ui->screen_2_img_1 = lv_img_create(ui->screen_2, NULL);

	//Write style LV_IMG_PART_MAIN for screen_2_img_1
	static lv_style_t style_screen_2_img_1_main;
	lv_style_reset(&style_screen_2_img_1_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_2_img_1_main
	lv_style_set_image_recolor(&style_screen_2_img_1_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_image_recolor_opa(&style_screen_2_img_1_main, LV_STATE_DEFAULT, 0);
	lv_style_set_image_opa(&style_screen_2_img_1_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_2_img_1, LV_IMG_PART_MAIN, &style_screen_2_img_1_main);
	lv_obj_set_pos(ui->screen_2_img_1, 219, 5);
	lv_obj_set_size(ui->screen_2_img_1, 15, 10);
	lv_obj_set_click(ui->screen_2_img_1, true);
	lv_img_set_src(ui->screen_2_img_1,&_dian_alpha_15x10);
	lv_img_set_pivot(ui->screen_2_img_1, 0,0);
	lv_img_set_angle(ui->screen_2_img_1, 0);

	//Write codes screen_2_img_2
	ui->screen_2_img_2 = lv_img_create(ui->screen_2, NULL);

	//Write style LV_IMG_PART_MAIN for screen_2_img_2
	static lv_style_t style_screen_2_img_2_main;
	lv_style_reset(&style_screen_2_img_2_main);

	//Write style state: LV_STATE_DEFAULT for style_screen_2_img_2_main
	lv_style_set_image_recolor(&style_screen_2_img_2_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_image_recolor_opa(&style_screen_2_img_2_main, LV_STATE_DEFAULT, 0);
	lv_style_set_image_opa(&style_screen_2_img_2_main, LV_STATE_DEFAULT, 255);
	lv_obj_add_style(ui->screen_2_img_2, LV_IMG_PART_MAIN, &style_screen_2_img_2_main);
	lv_obj_set_pos(ui->screen_2_img_2, 0, 0);
	lv_obj_set_size(ui->screen_2_img_2, 20, 20);
	lv_obj_set_click(ui->screen_2_img_2, true);
	lv_img_set_src(ui->screen_2_img_2,&_wifi_alpha_20x20);
	lv_img_set_pivot(ui->screen_2_img_2, 0,0);
	lv_img_set_angle(ui->screen_2_img_2, 0);

//	//Write codes screen_2_img_3
//	ui->screen_2_img_3 = lv_img_create(ui->screen_2, NULL);

//	//Write style LV_IMG_PART_MAIN for screen_2_img_3
//	static lv_style_t style_screen_2_img_3_main;
//	lv_style_reset(&style_screen_2_img_3_main);

//	//Write style state: LV_STATE_DEFAULT for style_screen_2_img_3_main
//	lv_style_set_image_recolor(&style_screen_2_img_3_main, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
//	lv_style_set_image_recolor_opa(&style_screen_2_img_3_main, LV_STATE_DEFAULT, 0);
//	lv_style_set_image_opa(&style_screen_2_img_3_main, LV_STATE_DEFAULT, 255);
//	lv_obj_add_style(ui->screen_2_img_3, LV_IMG_PART_MAIN, &style_screen_2_img_3_main);
//	lv_obj_set_pos(ui->screen_2_img_3, 0, 0);
//	lv_obj_set_size(ui->screen_2_img_3, 20, 20);
//	lv_obj_set_click(ui->screen_2_img_3, true);
//	lv_img_set_src(ui->screen_2_img_3,&_wifi_off_alpha_20x20);
//	lv_img_set_pivot(ui->screen_2_img_3, 0,0);
//	lv_img_set_angle(ui->screen_2_img_3, 0);

	//Write codes screen_2_calendar_1
	ui->screen_2_calendar_1 = lv_calendar_create(ui->screen_2, NULL);

	//Write style LV_CALENDAR_PART_BG for screen_2_calendar_1
	static lv_style_t style_screen_2_calendar_1_bg;
	lv_style_reset(&style_screen_2_calendar_1_bg);

	//Write style state: LV_STATE_DEFAULT for style_screen_2_calendar_1_bg
	lv_style_set_bg_color(&style_screen_2_calendar_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_color(&style_screen_2_calendar_1_bg, LV_STATE_DEFAULT, lv_color_make(0xff, 0xff, 0xff));
	lv_style_set_bg_grad_dir(&style_screen_2_calendar_1_bg, LV_STATE_DEFAULT, LV_GRAD_DIR_VER);
	lv_style_set_bg_opa(&style_screen_2_calendar_1_bg, LV_STATE_DEFAULT, 0);
	lv_style_set_border_color(&style_screen_2_calendar_1_bg, LV_STATE_DEFAULT, lv_color_make(0xb2, 0xf5, 0xdf));
	lv_style_set_border_width(&style_screen_2_calendar_1_bg, LV_STATE_DEFAULT, 1);
	lv_obj_add_style(ui->screen_2_calendar_1, LV_CALENDAR_PART_BG, &style_screen_2_calendar_1_bg);

	//Write style LV_CALENDAR_PART_HEADER for screen_2_calendar_1
	static lv_style_t style_screen_2_calendar_1_header;
	lv_style_reset(&style_screen_2_calendar_1_header);

	//Write style state: LV_STATE_DEFAULT for style_screen_2_calendar_1_header
	lv_style_set_text_color(&style_screen_2_calendar_1_header, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_style_set_text_font(&style_screen_2_calendar_1_header, LV_STATE_DEFAULT, &lv_font_simsun_20);
	lv_style_set_text_letter_space(&style_screen_2_calendar_1_header, LV_STATE_DEFAULT, 0);
	lv_obj_add_style(ui->screen_2_calendar_1, LV_CALENDAR_PART_HEADER, &style_screen_2_calendar_1_header);

	//Write style LV_CALENDAR_PART_DAY_NAMES for screen_2_calendar_1
	static lv_style_t style_screen_2_calendar_1_day_names;
	lv_style_reset(&style_screen_2_calendar_1_day_names);

	//Write style state: LV_STATE_DEFAULT for style_screen_2_calendar_1_day_names
	lv_style_set_text_color(&style_screen_2_calendar_1_day_names, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_style_set_text_font(&style_screen_2_calendar_1_day_names, LV_STATE_DEFAULT, &lv_font_simsun_16);
	lv_obj_add_style(ui->screen_2_calendar_1, LV_CALENDAR_PART_DAY_NAMES, &style_screen_2_calendar_1_day_names);

	//Write style LV_CALENDAR_PART_DATE for screen_2_calendar_1
	static lv_style_t style_screen_2_calendar_1_date;
	lv_style_reset(&style_screen_2_calendar_1_date);

	//Write style state: LV_STATE_DEFAULT for style_screen_2_calendar_1_date
	lv_style_set_text_color(&style_screen_2_calendar_1_date, LV_STATE_DEFAULT, lv_color_make(0x00, 0x00, 0x00));
	lv_style_set_text_font(&style_screen_2_calendar_1_date, LV_STATE_DEFAULT, &lv_font_simsun_13);
	lv_obj_add_style(ui->screen_2_calendar_1, LV_CALENDAR_PART_DATE, &style_screen_2_calendar_1_date);
	lv_obj_set_pos(ui->screen_2_calendar_1, 0, 34);
	lv_obj_set_size(ui->screen_2_calendar_1, 240, 282);
	today.year =2023;
	today.month =11;
	today.day =15;
	lv_calendar_set_today_date(ui->screen_2_calendar_1, &today);
	lv_calendar_set_showed_date(ui->screen_2_calendar_1, &today);
//	highlihted_days[0].year = 2020;
//	highlihted_days[0].month = 5;
//	highlihted_days[0].day = 14;
//	lv_calendar_set_highlighted_dates(ui->screen_2_calendar_1, highlihted_days, 1);
}